package index

import (
	"hotgo/addons/hgexample/model/input/sysin"
	"hotgo/internal/model"

	"github.com/gogf/gf/v2/frame/g"
)

type IndexReq struct {
	g.Meta `path:"/Index/index" method:"post" tags:"首页" summary:"首页"`
}

type IndexRes struct {
	Banner []*sysin.EpBannerListModel `json:"banner"   dc:"轮播图"`
	Config *model.BasicConfig         `json:"config"   dc:"配置"`
}

type GetCodeReq struct {
	g.Meta `path:"/index/getCode" method:"post" tags:"首页" summary:"获取验证码"`
	Code   string `json:"code" v:"required#code不能为空" dc:"验证码"`
}
type GetCodeRes struct {
	OpenId string `json:"openid" dc:"openid"`
}

type SetUserReq struct {
	g.Meta   `path:"/index/setUser" method:"post" tags:"首页" summary:"获取用户信息"`
	OpenId   string `json:"openid" v:"required#openid不能为空" dc:"openid"`
	Platform string `json:"platform" v:"required#平台不能为空" dc:"平台"`
}
type SetUserRes struct {
	OpenId  string `json:"openid" dc:"openid"`
	Token   string `json:"token" dc:"用户信息"`
	Expires int64  `json:"expires" dc:"过期时间"`
}

type GetUserReq struct {
	g.Meta `path:"/index/getUser" method:"post" tags:"首页" summary:"获取用户信息"`
}
type GetUserRes struct {
	User g.Map           `json:"user" dc:"用户信息"`
	Data *model.Identity `json:"data" dc:"用户信息"`
}
